<?php

namespace app\common\dao\repair;

use app\common\dao\BaseDao;
use app\common\model\repair\RepairPictureModel;

class RepairPictureDao extends BaseDao
{

    /**
     * @return RepairPictureModel
     */
    protected function getModel(): string
    {
        return RepairPictureModel::class;
    }

    /**
     * 删除报修图片
     * @param int $repairId
     * @return bool
     */
    public function clearRepairPicture(int $repairId, int $isType = 1)
    {
        return $this->getSearch([
            'is_type' => $isType,
            'repair_id' => $repairId
        ])->delete();
    }

}
